﻿using System.Collections.Generic;
using Microsoft.Web.WebPages.OAuth;

namespace SimpleScrum.App_Start
{
    public static class AuthConfig
    {
        public static void RegisterAuth()
        {
            var facebookSocialData = new Dictionary<string, object>();
            facebookSocialData.Add("Icon", "/SimpleScrum/Images/facebook.png");
            var twitterSocialData = new Dictionary<string, object>();
            twitterSocialData.Add("Icon", "/SimpleScrum/Images/twitter.png");
            var googleSocialData = new Dictionary<string, object>();
            googleSocialData.Add("Icon", "/SimpleScrum/Images/google.png");
            var yahooSocialData = new Dictionary<string, object>();
            yahooSocialData.Add("Icon", "/SimpleScrum/Images/yahoo.jpg");
            var linkedInSocialData = new Dictionary<string, object>();
            linkedInSocialData.Add("Icon", "/SimpleScrum/Images/linkedin.png");

            // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            // you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166

            //OAuthWebSecurity.RegisterMicrosoftClient(
            //    clientId: "",
            //    clientSecret: "");

            OAuthWebSecurity.RegisterFacebookClient(
                appId: "614991228522334",
                appSecret: "c0cdc113693407426866fba9c49492c6",
                displayName: "facebook",
                extraData: facebookSocialData);

            OAuthWebSecurity.RegisterTwitterClient(
                consumerKey: "C7n14YLZNDaVoHndGfOkQ",
                consumerSecret: "8UixLZgUlWdrgUfXWo3h7k2UJrGRVgwSfyLsa5wXpA",
                displayName: "twitter",
                extraData: twitterSocialData);

            OAuthWebSecurity.RegisterGoogleClient(
                displayName: "google",
                extraData: googleSocialData);

            OAuthWebSecurity.RegisterYahooClient(
                displayName: "Yahoo",
                extraData: yahooSocialData);

            OAuthWebSecurity.RegisterLinkedInClient(
                consumerKey: "2fifp886nyx5",
                consumerSecret: "0LBTjTjmq4xMHb9I",
                displayName: "LinkedIn",
                extraData: linkedInSocialData);

            //OAuthWebSecurity.RegisterClient(
            //    displayName: "Git",
            //    ClientID:"7dcee6c7adf1f5bda7d7",
            //    ClientSecret:"e207914d6d5af551ec8fb6449970bfde7a9189bc"
            //    );
        }
    }
}